<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>登录</title>
</head>
<style>
    *{
        margin:0;
        padding:0;
        list-style:none;
        text-decoration:none;
    }
</style>
<script>
    window.onload = function(){
        /*720代表设计师给的设计稿的宽度，你的设计稿是多少，就写多少;100代表换算比例，这里写100是
          为了以后好算,比如，你测量的一个宽度是100px,就可以写为1rem,以及1px=0.01rem等等*/
        getRem(375,100);
    };
    window.onresize = function(){
        getRem(375,100);
    };
    function getRem(pwidth,prem){
        var html = document.getElementsByTagName("html")[0];
        var oWidth = document.body.clientWidth || document.documentElement.clientWidth;
        html.style.fontSize = oWidth/pwidth*prem + "px";
    }
</script>

<body>


<!--<img src="../upload/20180205/Chrysanthemum.jpg" alt="" style="width:100px;height:100px;">-->

<div class="logo">
    <img src="img/logo.png" alt="" style="display:block;width:1.30rem;height:0.16rem;margin:0 auto;margin-top:0.383rem;">
</div>

<div style="width:90%;height:0.5rem;margin:0 auto;margin-top:1.6rem;border-bottom:1px solid #d8d8d8;">
    <input type="text" style="display:block;width:100%;height:0.4rem;margin-top:0.1rem;outline:none;border:none;font-family: PingFangSC-Medium;
font-size:0.16rem;
color: #969B9E;" class="username" placeholder="username">
</div>

<div style="width:90%;height:0.5rem;margin:0 auto;margin-top:0.2rem;border-bottom:1px solid #d8d8d8;">
    <input type="text" style="display:block;width:100%;height:0.4rem;margin-top:0.1rem;outline:none;border:none;font-family: PingFangSC-Medium;
font-size:0.16rem;
color: #969B9E;" class="password" placeholder="password">
</div>

<div class="logbutton" style="position:relative;">
    <img src="img/logbutton.png" alt="" style="width:3.14rem;height:0.43rem;margin:0 auto;margin-top:0.44rem;display:block;">
    <a href="add.html"><span style="text-align:center;line-height:0.43rem;color:#fff;font-size:0.18rem;font-family: PingFangSC-Medium;position:absolute;display:block;left:0;top:0;right:0;bottom:0;margin:auto;">Login</span></a>
</div>

</body>
<script src="jquery-1.8.3.min.js"></script>
<script src="js/commonscript.js"></script>
<script>
    $('.logbutton').on('click',function(){
        $.ajax({
            url:url+'/emp/login',
            datatype:'JSONP',
            type:'post',
            data:{telephone:$('.username').val(),password:$('.password').val()},
            success:function(result){
               if(result.state==0){
                   localStorage.token=result.data.token;
                   localStorage.tel=$('.username').val();
                   window.location.href='add.html';
               }
            }
        });
        return false;
    })
</script>
</html>